﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BUS;
using DTO;
using Microsoft.VisualBasic;
using System.Runtime.InteropServices;
using System.Media;

namespace DoAnHuongRung
{
    
    public partial class frmDangNhap : Form
    {
        public frmDangNhap()
        {
            InitializeComponent();
        }
        

        private void btnDangNhap_Click(object sender, EventArgs e)
        {
            bool b = NhanVienBUS.DangNhap(txtTenDN.Text, txtMatKhau.Text);
            SoundPlayer s;
            if (b == false)
            {
                s = new SoundPlayer(Properties.Resources.Windows_Error);
                s.Play();
                MessageBox.Show("Sai tên đăng nhập hoặc mật khẩu !!!");
            }
            else
            {
                s = new SoundPlayer(Properties.Resources.Windows_Logon);
                s.Play();
                frmMain frm = new frmMain();
                frm.Show();
                this.Hide();
            }
        }
    }
}
